﻿
@{
    Layout = null;
    QunProject.Model.member LoginMember = (QunProject.Model.member)ViewBag.LoginMember;
}

<div class="ui-top">
    <div class="layui-container p0">
        <div class="row">
            <div class="layui-col-md3">
                <a href="/home/index@(ViewBag.Suffix)"><img src="~/Content/img/logo.jpg" style="height:75px; width:280px;" /></a>
            </div>
            <div class="layui-col-md3 pt20 pl10 layui-hide-xs">
                <p class="c_aaa">业精于勤而荒于嬉</p>
                <p class="c_aaa" style="padding-left: 30px;">行成于思而毁于随&nbsp; — &nbsp;韩愈</p>
            </div>
            <div class="layui-col-md6 pt20 layui-hide-xs" style="padding-right:10px;">
                <input type="text" name="" placeholder="关键字" class="layui-input" style="width:calc(100% - 92px);float:left;">
                <a href="javascript:void(0)" class="layui-btn layui-btn-normal" style="width:80px;float:left;">搜索</a>
            </div>
        </div>
    </div>
</div>

<div class="ui-nav layui-hide-xs">
    <div class="layui-container p0">
        <div class="row">
            <div class="layui-col-md12">
                <ul class="layui-nav" lay-filter="">
                    <li class="layui-nav-item" id="nav-index">
                        <a href="/home/index@(ViewBag.Suffix)">首页</a>
                    </li>
                    <li class="layui-nav-item" id="nav-article">
                        <a href="/article/index@(ViewBag.Suffix)">知识分享</a>
                    </li>
                    <li class="layui-nav-item" id="nav-discuss">
                        <a href="/article/discuss@(ViewBag.Suffix)">技术讨论</a>
                    </li>
                    <li class="layui-nav-item" id="nav-special">
                        <a href="/article/special@(ViewBag.Suffix)">专题</a>
                    </li>
                    <li class="layui-nav-item" id="nav-about">
                        <a href="/home/about@(ViewBag.Suffix)">关于</a>
                    </li>
                    @if (LoginMember == null)
                    {
                        <li class="layui-nav-item right">
                            <a href="/login/Register@(ViewBag.Suffix)">注册</a>
                        </li>
                        <li class="layui-nav-item right">
                            <a href="/login/index@(ViewBag.Suffix)">登录</a>
                        </li>
                    }
                    else
                    {
                        <li class="layui-nav-item right">
                            <a href="/login/exit@(ViewBag.Suffix)">注销</a>
                        </li>
                        <li class="layui-nav-item right" id="nav-member">
                            <a href="/member/index@(ViewBag.Suffix)">@LoginMember.Name</a>
                        </li>
                    }
                </ul>
            </div>
        </div>
    </div>
</div>

<script>
    var webUrl = window.location.href.toLowerCase();
    if (webUrl.indexOf("/article/index") > -1 || webUrl.indexOf("/article/info") > -1) {
        $("#nav-article").addClass("layui-this");
    } else if (webUrl.indexOf("/article/discuss") > -1) {
        $("#nav-discuss").addClass("layui-this");
    } else if (webUrl.indexOf("/article/special") > -1 || webUrl.indexOf("/article/speciallist") > -1) {
        $("#nav-special").addClass("layui-this");
    } else if (webUrl.indexOf("/home/about") > -1) {
        $("#nav-about").addClass("layui-this");
    } else if (webUrl.indexOf("/member/") > -1) {
        $("#nav-member").addClass("layui-this");
    } else {
        $("#nav-index").addClass("layui-this");
    }
</script>